package com.rbs.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.rbs.entity.SalesOrDept;
import com.rbs.mapper.SalesOrDeptMapper;
import com.rbs.service.ISalesOrDeptService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rbs.vo.SalesVO;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 业务员表 服务实现类
 * </p>
 *
 * @author lisl
 * @since 2024-04-08
 */
@Service
public class SalesOrDeptServiceImpl extends ServiceImpl<SalesOrDeptMapper, SalesOrDept> implements ISalesOrDeptService {
    @Autowired
    private SalesOrDeptMapper salesOrDeptMapper;

    @Override
    public List<SalesVO> getAll() {
        List<SalesVO> salesVOList=salesOrDeptMapper.getAll();
        return salesVOList;
    }

    @Override
    public List<SalesOrDept> findByName(SalesOrDept salesOrDept) {
        LambdaQueryWrapper<SalesOrDept> wrapper=new LambdaQueryWrapper<SalesOrDept>().like(salesOrDept.getSodStrname()!=null,SalesOrDept::getSodStrname,salesOrDept.getSodStrname());
        List<SalesOrDept> list = salesOrDeptMapper.selectList(wrapper);
        return list;
    }
}
